<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!--<title>Spring Boot Thymeleaf + Spring Security</title>-->

    <div th:replace="/fragments/header :: header-css"/>

</head>
<body class="bg-light">
<div th:replace="/fragments/header :: header"/>
<div class="container">

    <!--如果注册成功显示这个-->


    <form class="form-signin" autocomplete="off" action="#" th:action="@{/registration}"
          th:object="${user}" method="post" role="form">
        <h3 class="text-center">注册</h3>
        <div class="alert alert-info" th:if="${successMessage}" th:utext="${successMessage}">
        </div>
        <div class="form-label-group">
            <label th:if="${#fields.hasErrors('username')}" th:errors="*{username}"
                   class="alert alert-danger" style="width: 100%">
            </label>
            <input type="text" th:field="*{username}" placeholder="用户名"
                   class="form-control"/>
        </div>
        <div class="form-label-group">
            <label th:if="${#fields.hasErrors('password')}" th:errors="*{password}"
                   class="alert alert-danger" style="width: 100%">
            </label>
            <input type="password" th:field="*{password}" placeholder="密码"
                   class="form-control"/>
        </div>
        <input type="submit" class="btn btn-lg btn-primary btn-block" value="注册"/>
    </form>
</div>

<div th:replace="/fragments/footer :: footer"/>

</body>
</html>